<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-2"></span><span class="hs-comment">-- ----------------------------------------------------------------------------</span><span>
</span><span id="line-3"></span><span class="hs-comment">-- | Handle conversion of CmmData to LLVM code.</span><span>
</span><span id="line-4"></span><span class="hs-comment">--</span><span>
</span><span id="line-5"></span><span>
</span><span id="line-6"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.CmmToLlvm.Data</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-7"></span><span>        </span><span class="annot"><a href="GHC.CmmToLlvm.Data.html#genLlvmData"><span class="hs-identifier">genLlvmData</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.CmmToLlvm.Data.html#genData"><span class="hs-identifier">genData</span></a></span><span>
</span><span id="line-8"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-12"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-13"></span><span>
</span><span id="line-14"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Llvm.html"><span class="hs-identifier">GHC.Llvm</span></a></span><span>
</span><span id="line-15"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.CmmToLlvm.Base.html"><span class="hs-identifier">GHC.CmmToLlvm.Base</span></a></span><span>
</span><span id="line-16"></span><span>
</span><span id="line-17"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html"><span class="hs-identifier">GHC.Cmm.BlockId</span></a></span><span>
</span><span id="line-18"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html"><span class="hs-identifier">GHC.Cmm.CLabel</span></a></span><span>
</span><span id="line-19"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.html"><span class="hs-identifier">GHC.Cmm</span></a></span><span>
</span><span id="line-20"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#"><span class="hs-identifier">GHC.Platform</span></a></span><span>
</span><span id="line-21"></span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html"><span class="hs-identifier">GHC.Data.FastString</span></a></span><span>
</span><span id="line-23"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-24"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.html#"><span class="hs-identifier">Data.ByteString</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">BS</span></span><span>
</span><span id="line-25"></span><span>
</span><span id="line-26"></span><span class="hs-comment">-- ----------------------------------------------------------------------------</span><span>
</span><span id="line-27"></span><span class="hs-comment">-- * Constants</span><span>
</span><span id="line-28"></span><span class="hs-comment">--</span><span>
</span><span id="line-29"></span><span>
</span><span id="line-30"></span><span class="hs-comment">-- | The string appended to a variable name to create its structure type alias</span><span>
</span><span id="line-31"></span><span class="annot"><a href="GHC.CmmToLlvm.Data.html#structStr"><span class="hs-identifier hs-type">structStr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Llvm.Types.html#LMString"><span class="hs-identifier hs-type">LMString</span></a></span><span>
</span><span id="line-32"></span><span id="structStr"><span class="annot"><span class="annottext">structStr :: LMString
</span><a href="GHC.CmmToLlvm.Data.html#structStr"><span class="hs-identifier hs-var hs-var">structStr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; LMString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;_struct&quot;</span></span><span>
</span><span id="line-33"></span><span>
</span><span id="line-34"></span><span class="hs-comment">-- | The LLVM visibility of the label</span><span>
</span><span id="line-35"></span><span class="annot"><a href="GHC.CmmToLlvm.Data.html#linkage"><span class="hs-identifier hs-type">linkage</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Llvm.Types.html#LlvmLinkageType"><span class="hs-identifier hs-type">LlvmLinkageType</span></a></span><span>
</span><span id="line-36"></span><span id="linkage"><span class="annot"><span class="annottext">linkage :: CLabel -&gt; LlvmLinkageType
</span><a href="GHC.CmmToLlvm.Data.html#linkage"><span class="hs-identifier hs-var hs-var">linkage</span></a></span></span><span> </span><span id="local-6989586621681013267"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681013267"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; Bool
</span><a href="GHC.Cmm.CLabel.html#externallyVisibleCLabel"><span class="hs-identifier hs-var">externallyVisibleCLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681013267"><span class="hs-identifier hs-var">lbl</span></a></span><span>
</span><span id="line-37"></span><span>              </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">LlvmLinkageType
</span><a href="GHC.Llvm.Types.html#ExternallyVisible"><span class="hs-identifier hs-var">ExternallyVisible</span></a></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">LlvmLinkageType
</span><a href="GHC.Llvm.Types.html#Internal"><span class="hs-identifier hs-var">Internal</span></a></span><span>
</span><span id="line-38"></span><span>
</span><span id="line-39"></span><span class="hs-comment">-- ----------------------------------------------------------------------------</span><span>
</span><span id="line-40"></span><span class="hs-comment">-- * Top level</span><span>
</span><span id="line-41"></span><span class="hs-comment">--</span><span>
</span><span id="line-42"></span><span>
</span><span id="line-43"></span><span class="hs-comment">-- | Pass a CmmStatic section to an equivalent Llvm code.</span><span>
</span><span id="line-44"></span><span class="annot"><a href="GHC.CmmToLlvm.Data.html#genLlvmData"><span class="hs-identifier hs-type">genLlvmData</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#Section"><span class="hs-identifier hs-type">Section</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.html#RawCmmStatics"><span class="hs-identifier hs-type">RawCmmStatics</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CmmToLlvm.Base.html#LlvmM"><span class="hs-identifier hs-type">LlvmM</span></a></span><span> </span><span class="annot"><a href="GHC.CmmToLlvm.Base.html#LlvmData"><span class="hs-identifier hs-type">LlvmData</span></a></span><span>
</span><span id="line-45"></span><span class="hs-comment">-- See note [emit-time elimination of static indirections] in &quot;GHC.Cmm.CLabel&quot;.</span><span>
</span><span id="line-46"></span><span id="genLlvmData"><span class="annot"><span class="annottext">genLlvmData :: (Section, RawCmmStatics) -&gt; LlvmM LlvmData
</span><a href="GHC.CmmToLlvm.Data.html#genLlvmData"><span class="hs-identifier hs-var hs-var">genLlvmData</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Section
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmStaticsRaw"><span class="hs-identifier hs-type">CmmStaticsRaw</span></a></span><span> </span><span id="local-6989586621681013262"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681013262"><span class="hs-identifier hs-var">alias</span></a></span></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.html#CmmStaticLit"><span class="hs-identifier hs-type">CmmStaticLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLabel"><span class="hs-identifier hs-type">CmmLabel</span></a></span><span> </span><span id="local-6989586621681013259"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681013259"><span class="hs-identifier hs-var">lbl</span></a></span></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmStaticLit"><span class="hs-identifier hs-type">CmmStaticLit</span></a></span><span> </span><span id="local-6989586621681013258"><span class="annot"><span class="annottext">CmmLit
</span><a href="#local-6989586621681013258"><span class="hs-identifier hs-var">ind</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmStatic
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmStatic
</span><span class="hs-identifier">_</span></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-47"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681013259"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; CLabel -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="GHC.Cmm.CLabel.html#mkIndStaticInfoLabel"><span class="hs-identifier hs-var">mkIndStaticInfoLabel</span></a></span><span>
</span><span id="line-48"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681013256"><span class="annot"><span class="annottext">labelInd :: CmmLit -&gt; Maybe CLabel
</span><a href="#local-6989586621681013256"><span class="hs-identifier hs-var hs-var">labelInd</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLabelOff"><span class="hs-identifier hs-type">CmmLabelOff</span></a></span><span> </span><span id="local-6989586621681013254"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681013254"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; Maybe CLabel
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681013254"><span class="hs-identifier hs-var">l</span></a></span><span>
</span><span id="line-49"></span><span>        </span><span class="annot"><a href="#local-6989586621681013256"><span class="hs-identifier hs-var">labelInd</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLabel"><span class="hs-identifier hs-type">CmmLabel</span></a></span><span> </span><span id="local-6989586621681013253"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681013253"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; Maybe CLabel
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681013253"><span class="hs-identifier hs-var">l</span></a></span><span>
</span><span id="line-50"></span><span>        </span><span class="annot"><a href="#local-6989586621681013256"><span class="hs-identifier hs-var">labelInd</span></a></span><span> </span><span class="annot"><span class="annottext">CmmLit
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe CLabel
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-51"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681013252"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681013252"><span class="hs-identifier hs-var">ind'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmmLit -&gt; Maybe CLabel
</span><a href="#local-6989586621681013256"><span class="hs-identifier hs-var">labelInd</span></a></span><span> </span><span class="annot"><span class="annottext">CmmLit
</span><a href="#local-6989586621681013258"><span class="hs-identifier hs-var">ind</span></a></span><span>
</span><span id="line-52"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681013262"><span class="hs-identifier hs-var">alias</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; CLabel -&gt; Bool
</span><a href="GHC.Cmm.CLabel.html#mayRedirectTo"><span class="hs-operator hs-var">`mayRedirectTo`</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681013252"><span class="hs-identifier hs-var">ind'</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-53"></span><span>    </span><span id="local-6989586621681013250"><span class="annot"><span class="annottext">LMString
</span><a href="#local-6989586621681013250"><span class="hs-keyword hs-var">label</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; LlvmM LMString
</span><a href="GHC.CmmToLlvm.Base.html#strCLabel_llvm"><span class="hs-identifier hs-var">strCLabel_llvm</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681013262"><span class="hs-identifier hs-var">alias</span></a></span><span>
</span><span id="line-54"></span><span>    </span><span id="local-6989586621681013248"><span class="annot"><span class="annottext">LMString
</span><a href="#local-6989586621681013248"><span class="hs-identifier hs-var">label'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; LlvmM LMString
</span><a href="GHC.CmmToLlvm.Base.html#strCLabel_llvm"><span class="hs-identifier hs-var">strCLabel_llvm</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681013252"><span class="hs-identifier hs-var">ind'</span></a></span><span>
</span><span id="line-55"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681013247"><span class="annot"><span class="annottext">link :: LlvmLinkageType
</span><a href="#local-6989586621681013247"><span class="hs-identifier hs-var hs-var">link</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; LlvmLinkageType
</span><a href="GHC.CmmToLlvm.Data.html#linkage"><span class="hs-identifier hs-var">linkage</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681013262"><span class="hs-identifier hs-var">alias</span></a></span><span>
</span><span id="line-56"></span><span>        </span><span id="local-6989586621681013246"><span class="annot"><span class="annottext">link' :: LlvmLinkageType
</span><a href="#local-6989586621681013246"><span class="hs-identifier hs-var hs-var">link'</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; LlvmLinkageType
</span><a href="GHC.CmmToLlvm.Data.html#linkage"><span class="hs-identifier hs-var">linkage</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681013252"><span class="hs-identifier hs-var">ind'</span></a></span><span>
</span><span id="line-57"></span><span>        </span><span class="hs-comment">-- the LLVM type we give the alias is an empty struct type</span><span>
</span><span id="line-58"></span><span>        </span><span class="hs-comment">-- but it doesn't really matter, as the pointer is only</span><span>
</span><span id="line-59"></span><span>        </span><span class="hs-comment">-- used for (bit/int)casting.</span><span>
</span><span id="line-60"></span><span>        </span><span id="local-6989586621681013245"><span class="annot"><span class="annottext">tyAlias :: LlvmType
</span><a href="#local-6989586621681013245"><span class="hs-identifier hs-var hs-var">tyAlias</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LlvmAlias -&gt; LlvmType
</span><a href="GHC.Llvm.Types.html#LMAlias"><span class="hs-identifier hs-var">LMAlias</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LMString
</span><a href="#local-6989586621681013250"><span class="hs-keyword hs-var">label</span></a></span><span> </span><span class="annot"><span class="annottext">LMString -&gt; LMString -&gt; LMString
</span><a href="GHC.Data.FastString.html#appendFS"><span class="hs-operator hs-var">`appendFS`</span></a></span><span> </span><span class="annot"><span class="annottext">LMString
</span><a href="GHC.CmmToLlvm.Data.html#structStr"><span class="hs-identifier hs-var">structStr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[LlvmType] -&gt; LlvmType
</span><a href="GHC.Llvm.Types.html#LMStructU"><span class="hs-identifier hs-var">LMStructU</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-61"></span><span>
</span><span id="line-62"></span><span>        </span><span id="local-6989586621681013241"><span class="annot"><span class="annottext">aliasDef :: LlvmVar
</span><a href="#local-6989586621681013241"><span class="hs-identifier hs-var hs-var">aliasDef</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LMString
-&gt; LlvmType
-&gt; LlvmLinkageType
-&gt; LMSection
-&gt; LMAlign
-&gt; LMConst
-&gt; LlvmVar
</span><a href="GHC.Llvm.Types.html#LMGlobalVar"><span class="hs-identifier hs-var">LMGlobalVar</span></a></span><span> </span><span class="annot"><span class="annottext">LMString
</span><a href="#local-6989586621681013250"><span class="hs-keyword hs-var">label</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmType
</span><a href="#local-6989586621681013245"><span class="hs-identifier hs-var">tyAlias</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmLinkageType
</span><a href="#local-6989586621681013247"><span class="hs-identifier hs-var">link</span></a></span><span> </span><span class="annot"><span class="annottext">LMSection
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">LMAlign
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">LMConst
</span><a href="GHC.Llvm.Types.html#Alias"><span class="hs-identifier hs-var">Alias</span></a></span><span>
</span><span id="line-63"></span><span>        </span><span class="hs-comment">-- we don't know the type of the indirectee here</span><span>
</span><span id="line-64"></span><span>        </span><span id="local-6989586621681013238"><span class="annot"><span class="annottext">indType :: a
</span><a href="#local-6989586621681013238"><span class="hs-identifier hs-var hs-var">indType</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; a
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;will be filled by 'aliasify', later&quot;</span></span><span>
</span><span id="line-65"></span><span>        </span><span id="local-6989586621681013236"><span class="annot"><span class="annottext">orig :: LlvmStatic
</span><a href="#local-6989586621681013236"><span class="hs-identifier hs-var hs-var">orig</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LlvmVar -&gt; LlvmStatic
</span><a href="GHC.Llvm.Types.html#LMStaticPointer"><span class="hs-identifier hs-var">LMStaticPointer</span></a></span><span> </span><span class="annot"><span class="annottext">(LlvmVar -&gt; LlvmStatic) -&gt; LlvmVar -&gt; LlvmStatic
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">LMString
-&gt; LlvmType
-&gt; LlvmLinkageType
-&gt; LMSection
-&gt; LMAlign
-&gt; LMConst
-&gt; LlvmVar
</span><a href="GHC.Llvm.Types.html#LMGlobalVar"><span class="hs-identifier hs-var">LMGlobalVar</span></a></span><span> </span><span class="annot"><span class="annottext">LMString
</span><a href="#local-6989586621681013248"><span class="hs-identifier hs-var">label'</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmType
forall {a}. a
</span><a href="#local-6989586621681013238"><span class="hs-identifier hs-var">indType</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmLinkageType
</span><a href="#local-6989586621681013246"><span class="hs-identifier hs-var">link'</span></a></span><span> </span><span class="annot"><span class="annottext">LMSection
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">LMAlign
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">LMConst
</span><a href="GHC.Llvm.Types.html#Alias"><span class="hs-identifier hs-var">Alias</span></a></span><span>
</span><span id="line-66"></span><span>
</span><span id="line-67"></span><span>    </span><span class="annot"><span class="annottext">LlvmData -&gt; LlvmM LlvmData
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><span class="annottext">LlvmVar -&gt; Maybe LlvmStatic -&gt; LMGlobal
</span><a href="GHC.Llvm.Types.html#LMGlobal"><span class="hs-identifier hs-var">LMGlobal</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmVar
</span><a href="#local-6989586621681013241"><span class="hs-identifier hs-var">aliasDef</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe LlvmStatic -&gt; LMGlobal) -&gt; Maybe LlvmStatic -&gt; LMGlobal
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmStatic -&gt; Maybe LlvmStatic
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmStatic
</span><a href="#local-6989586621681013236"><span class="hs-identifier hs-var">orig</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">LlvmType
</span><a href="#local-6989586621681013245"><span class="hs-identifier hs-var">tyAlias</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-68"></span><span>
</span><span id="line-69"></span><span class="annot"><a href="GHC.CmmToLlvm.Data.html#genLlvmData"><span class="hs-identifier hs-var">genLlvmData</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681013233"><span class="annot"><span class="annottext">Section
</span><a href="#local-6989586621681013233"><span class="hs-identifier hs-var">sec</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmStaticsRaw"><span class="hs-identifier hs-type">CmmStaticsRaw</span></a></span><span> </span><span id="local-6989586621681013232"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681013232"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span id="local-6989586621681013231"><span class="annot"><span class="annottext">[CmmStatic]
</span><a href="#local-6989586621681013231"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-70"></span><span>    </span><span id="local-6989586621681013230"><span class="annot"><span class="annottext">LMString
</span><a href="#local-6989586621681013230"><span class="hs-keyword hs-var">label</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; LlvmM LMString
</span><a href="GHC.CmmToLlvm.Base.html#strCLabel_llvm"><span class="hs-identifier hs-var">strCLabel_llvm</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681013232"><span class="hs-identifier hs-var">lbl</span></a></span><span>
</span><span id="line-71"></span><span>    </span><span id="local-6989586621681013229"><span class="annot"><span class="annottext">[LlvmStatic]
</span><a href="#local-6989586621681013229"><span class="hs-identifier hs-var">static</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(CmmStatic -&gt; LlvmM LlvmStatic)
-&gt; [CmmStatic] -&gt; LlvmM [LlvmStatic]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">CmmStatic -&gt; LlvmM LlvmStatic
</span><a href="GHC.CmmToLlvm.Data.html#genData"><span class="hs-identifier hs-var">genData</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmStatic]
</span><a href="#local-6989586621681013231"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-72"></span><span>    </span><span id="local-6989586621681013227"><span class="annot"><span class="annottext">LMSection
</span><a href="#local-6989586621681013227"><span class="hs-identifier hs-var">lmsec</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Section -&gt; LlvmM LMSection
</span><a href="GHC.CmmToLlvm.Data.html#llvmSection"><span class="hs-identifier hs-var">llvmSection</span></a></span><span> </span><span class="annot"><span class="annottext">Section
</span><a href="#local-6989586621681013233"><span class="hs-identifier hs-var">sec</span></a></span><span>
</span><span id="line-73"></span><span>    </span><span id="local-6989586621681013225"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681013225"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LlvmM Platform
</span><a href="GHC.CmmToLlvm.Base.html#getPlatform"><span class="hs-identifier hs-var">getPlatform</span></a></span><span>
</span><span id="line-74"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681013223"><span class="annot"><span class="annottext">types :: [LlvmType]
</span><a href="#local-6989586621681013223"><span class="hs-identifier hs-var hs-var">types</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LlvmStatic -&gt; LlvmType) -&gt; [LlvmStatic] -&gt; [LlvmType]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmStatic -&gt; LlvmType
</span><a href="GHC.Llvm.Types.html#getStatType"><span class="hs-identifier hs-var">getStatType</span></a></span><span> </span><span class="annot"><span class="annottext">[LlvmStatic]
</span><a href="#local-6989586621681013229"><span class="hs-identifier hs-var">static</span></a></span><span>
</span><span id="line-75"></span><span>
</span><span id="line-76"></span><span>        </span><span id="local-6989586621681013221"><span class="annot"><span class="annottext">strucTy :: LlvmType
</span><a href="#local-6989586621681013221"><span class="hs-identifier hs-var hs-var">strucTy</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[LlvmType] -&gt; LlvmType
</span><a href="GHC.Llvm.Types.html#LMStruct"><span class="hs-identifier hs-var">LMStruct</span></a></span><span> </span><span class="annot"><span class="annottext">[LlvmType]
</span><a href="#local-6989586621681013223"><span class="hs-identifier hs-var">types</span></a></span><span>
</span><span id="line-77"></span><span>        </span><span id="local-6989586621681013219"><span class="annot"><span class="annottext">tyAlias :: LlvmType
</span><a href="#local-6989586621681013219"><span class="hs-identifier hs-var hs-var">tyAlias</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LlvmAlias -&gt; LlvmType
</span><a href="GHC.Llvm.Types.html#LMAlias"><span class="hs-identifier hs-var">LMAlias</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LMString
</span><a href="#local-6989586621681013230"><span class="hs-keyword hs-var">label</span></a></span><span> </span><span class="annot"><span class="annottext">LMString -&gt; LMString -&gt; LMString
</span><a href="GHC.Data.FastString.html#appendFS"><span class="hs-operator hs-var">`appendFS`</span></a></span><span> </span><span class="annot"><span class="annottext">LMString
</span><a href="GHC.CmmToLlvm.Data.html#structStr"><span class="hs-identifier hs-var">structStr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">LlvmType
</span><a href="#local-6989586621681013221"><span class="hs-identifier hs-var">strucTy</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-78"></span><span>
</span><span id="line-79"></span><span>        </span><span id="local-6989586621681013218"><span class="annot"><span class="annottext">struct :: Maybe LlvmStatic
</span><a href="#local-6989586621681013218"><span class="hs-identifier hs-var hs-var">struct</span></a></span></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LlvmStatic -&gt; Maybe LlvmStatic
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">(LlvmStatic -&gt; Maybe LlvmStatic) -&gt; LlvmStatic -&gt; Maybe LlvmStatic
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[LlvmStatic] -&gt; LlvmType -&gt; LlvmStatic
</span><a href="GHC.Llvm.Types.html#LMStaticStruc"><span class="hs-identifier hs-var">LMStaticStruc</span></a></span><span> </span><span class="annot"><span class="annottext">[LlvmStatic]
</span><a href="#local-6989586621681013229"><span class="hs-identifier hs-var">static</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmType
</span><a href="#local-6989586621681013219"><span class="hs-identifier hs-var">tyAlias</span></a></span><span>
</span><span id="line-80"></span><span>        </span><span id="local-6989586621681013216"><span class="annot"><span class="annottext">link :: LlvmLinkageType
</span><a href="#local-6989586621681013216"><span class="hs-identifier hs-var hs-var">link</span></a></span></span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; LlvmLinkageType
</span><a href="GHC.CmmToLlvm.Data.html#linkage"><span class="hs-identifier hs-var">linkage</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681013232"><span class="hs-identifier hs-var">lbl</span></a></span><span>
</span><span id="line-81"></span><span>        </span><span id="local-6989586621681013210"><span class="annot"><span class="annottext">align :: LMAlign
</span><a href="#local-6989586621681013210"><span class="hs-identifier hs-var hs-var">align</span></a></span></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Section
</span><a href="#local-6989586621681013233"><span class="hs-identifier hs-var">sec</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-82"></span><span>                            </span><span class="annot"><a href="GHC.Cmm.html#Section"><span class="hs-identifier hs-type">Section</span></a></span><span> </span><span class="annot"><span class="annottext">SectionType
</span><a href="GHC.Cmm.html#CString"><span class="hs-identifier hs-var">CString</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; Arch
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformArch"><span class="hs-identifier hs-var">platformArch</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681013225"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">Arch -&gt; Arch -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Arch
</span><a href="../../ghc-boot/src/GHC.Platform.html#ArchS390X"><span class="hs-identifier hs-var">ArchS390X</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-83"></span><span>                                                    </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Int -&gt; LMAlign
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Int -&gt; LMAlign
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-84"></span><span>                            </span><span class="annot"><span class="annottext">Section
</span><span class="hs-identifier">_</span></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">LMAlign
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-85"></span><span>        </span><span id="local-6989586621681013203"><span class="annot"><span class="annottext">const :: LMConst
</span><a href="#local-6989586621681013203"><span class="hs-identifier hs-var hs-var">const</span></a></span></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Section -&gt; SectionProtection
</span><a href="GHC.Cmm.html#sectionProtection"><span class="hs-identifier hs-var">sectionProtection</span></a></span><span> </span><span class="annot"><span class="annottext">Section
</span><a href="#local-6989586621681013233"><span class="hs-identifier hs-var">sec</span></a></span><span> </span><span class="annot"><span class="annottext">SectionProtection -&gt; SectionProtection -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">SectionProtection
</span><a href="GHC.Cmm.html#ReadOnlySection"><span class="hs-identifier hs-var">ReadOnlySection</span></a></span><span>
</span><span id="line-86"></span><span>                            </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">LMConst
</span><a href="GHC.Llvm.Types.html#Constant"><span class="hs-identifier hs-var">Constant</span></a></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">LMConst
</span><a href="GHC.Llvm.Types.html#Global"><span class="hs-identifier hs-var">Global</span></a></span><span>
</span><span id="line-87"></span><span>        </span><span id="local-6989586621681013198"><span class="annot"><span class="annottext">varDef :: LlvmVar
</span><a href="#local-6989586621681013198"><span class="hs-identifier hs-var hs-var">varDef</span></a></span></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LMString
-&gt; LlvmType
-&gt; LlvmLinkageType
-&gt; LMSection
-&gt; LMAlign
-&gt; LMConst
-&gt; LlvmVar
</span><a href="GHC.Llvm.Types.html#LMGlobalVar"><span class="hs-identifier hs-var">LMGlobalVar</span></a></span><span> </span><span class="annot"><span class="annottext">LMString
</span><a href="#local-6989586621681013230"><span class="hs-keyword hs-var">label</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmType
</span><a href="#local-6989586621681013219"><span class="hs-identifier hs-var">tyAlias</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmLinkageType
</span><a href="#local-6989586621681013216"><span class="hs-identifier hs-var">link</span></a></span><span> </span><span class="annot"><span class="annottext">LMSection
</span><a href="#local-6989586621681013227"><span class="hs-identifier hs-var">lmsec</span></a></span><span> </span><span class="annot"><span class="annottext">LMAlign
</span><a href="#local-6989586621681013210"><span class="hs-identifier hs-var">align</span></a></span><span> </span><span class="annot"><span class="annottext">LMConst
</span><a href="#local-6989586621681013203"><span class="hs-identifier hs-var">const</span></a></span><span>
</span><span id="line-88"></span><span>        </span><span id="local-6989586621681013197"><span class="annot"><span class="annottext">globDef :: LMGlobal
</span><a href="#local-6989586621681013197"><span class="hs-identifier hs-var hs-var">globDef</span></a></span></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LlvmVar -&gt; Maybe LlvmStatic -&gt; LMGlobal
</span><a href="GHC.Llvm.Types.html#LMGlobal"><span class="hs-identifier hs-var">LMGlobal</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmVar
</span><a href="#local-6989586621681013198"><span class="hs-identifier hs-var">varDef</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe LlvmStatic
</span><a href="#local-6989586621681013218"><span class="hs-identifier hs-var">struct</span></a></span><span>
</span><span id="line-89"></span><span>
</span><span id="line-90"></span><span>    </span><span class="annot"><span class="annottext">LlvmData -&gt; LlvmM LlvmData
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><span class="annottext">LMGlobal
</span><a href="#local-6989586621681013197"><span class="hs-identifier hs-var">globDef</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">LlvmType
</span><a href="#local-6989586621681013219"><span class="hs-identifier hs-var">tyAlias</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-91"></span><span>
</span><span id="line-92"></span><span class="hs-comment">-- | Format the section type part of a Cmm Section</span><span>
</span><span id="line-93"></span><span class="annot"><a href="GHC.CmmToLlvm.Data.html#llvmSectionType"><span class="hs-identifier hs-type">llvmSectionType</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.html#SectionType"><span class="hs-identifier hs-type">SectionType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span>
</span><span id="line-94"></span><span id="llvmSectionType"><span class="annot"><span class="annottext">llvmSectionType :: Platform -&gt; SectionType -&gt; LMString
</span><a href="GHC.CmmToLlvm.Data.html#llvmSectionType"><span class="hs-identifier hs-var hs-var">llvmSectionType</span></a></span></span><span> </span><span id="local-6989586621681013194"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681013194"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621681013193"><span class="annot"><span class="annottext">SectionType
</span><a href="#local-6989586621681013193"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">SectionType
</span><a href="#local-6989586621681013193"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-95"></span><span>    </span><span class="annot"><span class="annottext">SectionType
</span><a href="GHC.Cmm.html#Text"><span class="hs-identifier hs-var">Text</span></a></span><span>                    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; LMString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;.text&quot;</span></span><span>
</span><span id="line-96"></span><span>    </span><span class="annot"><span class="annottext">SectionType
</span><a href="GHC.Cmm.html#ReadOnlyData"><span class="hs-identifier hs-var">ReadOnlyData</span></a></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; OS
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformOS"><span class="hs-identifier hs-var">platformOS</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681013194"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-97"></span><span>                                 </span><span class="annot"><span class="annottext">OS
</span><a href="../../ghc-boot/src/GHC.Platform.html#OSMinGW32"><span class="hs-identifier hs-var">OSMinGW32</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; LMString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;.rdata&quot;</span></span><span>
</span><span id="line-98"></span><span>                                 </span><span class="annot"><span class="annottext">OS
</span><span class="hs-identifier">_</span></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; LMString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;.rodata&quot;</span></span><span>
</span><span id="line-99"></span><span>    </span><span class="annot"><span class="annottext">SectionType
</span><a href="GHC.Cmm.html#RelocatableReadOnlyData"><span class="hs-identifier hs-var">RelocatableReadOnlyData</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; OS
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformOS"><span class="hs-identifier hs-var">platformOS</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681013194"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-100"></span><span>                                 </span><span class="annot"><span class="annottext">OS
</span><a href="../../ghc-boot/src/GHC.Platform.html#OSMinGW32"><span class="hs-identifier hs-var">OSMinGW32</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; LMString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;.rdata$rel.ro&quot;</span></span><span>
</span><span id="line-101"></span><span>                                 </span><span class="annot"><span class="annottext">OS
</span><span class="hs-identifier">_</span></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; LMString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;.data.rel.ro&quot;</span></span><span>
</span><span id="line-102"></span><span>    </span><span class="annot"><span class="annottext">SectionType
</span><a href="GHC.Cmm.html#ReadOnlyData16"><span class="hs-identifier hs-var">ReadOnlyData16</span></a></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; OS
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformOS"><span class="hs-identifier hs-var">platformOS</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681013194"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-103"></span><span>                                 </span><span class="annot"><span class="annottext">OS
</span><a href="../../ghc-boot/src/GHC.Platform.html#OSMinGW32"><span class="hs-identifier hs-var">OSMinGW32</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; LMString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;.rdata$cst16&quot;</span></span><span>
</span><span id="line-104"></span><span>                                 </span><span class="annot"><span class="annottext">OS
</span><span class="hs-identifier">_</span></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; LMString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;.rodata.cst16&quot;</span></span><span>
</span><span id="line-105"></span><span>    </span><span class="annot"><span class="annottext">SectionType
</span><a href="GHC.Cmm.html#Data"><span class="hs-identifier hs-var">Data</span></a></span><span>                    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; LMString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;.data&quot;</span></span><span>
</span><span id="line-106"></span><span>    </span><span class="annot"><span class="annottext">SectionType
</span><a href="GHC.Cmm.html#UninitialisedData"><span class="hs-identifier hs-var">UninitialisedData</span></a></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; LMString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;.bss&quot;</span></span><span>
</span><span id="line-107"></span><span>    </span><span class="annot"><span class="annottext">SectionType
</span><a href="GHC.Cmm.html#CString"><span class="hs-identifier hs-var">CString</span></a></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; OS
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformOS"><span class="hs-identifier hs-var">platformOS</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681013194"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-108"></span><span>                                 </span><span class="annot"><span class="annottext">OS
</span><a href="../../ghc-boot/src/GHC.Platform.html#OSMinGW32"><span class="hs-identifier hs-var">OSMinGW32</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; LMString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;.rdata$str&quot;</span></span><span>
</span><span id="line-109"></span><span>                                 </span><span class="annot"><span class="annottext">OS
</span><span class="hs-identifier">_</span></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; LMString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;.rodata.str&quot;</span></span><span>
</span><span id="line-110"></span><span>    </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#OtherSection"><span class="hs-identifier hs-type">OtherSection</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; LMString
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;llvmSectionType: unknown section type&quot;</span></span><span>
</span><span id="line-111"></span><span>
</span><span id="line-112"></span><span class="hs-comment">-- | Format a Cmm Section into a LLVM section name</span><span>
</span><span id="line-113"></span><span class="annot"><a href="GHC.CmmToLlvm.Data.html#llvmSection"><span class="hs-identifier hs-type">llvmSection</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.html#Section"><span class="hs-identifier hs-type">Section</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CmmToLlvm.Base.html#LlvmM"><span class="hs-identifier hs-type">LlvmM</span></a></span><span> </span><span class="annot"><a href="GHC.Llvm.Types.html#LMSection"><span class="hs-identifier hs-type">LMSection</span></a></span><span>
</span><span id="line-114"></span><span id="llvmSection"><span class="annot"><span class="annottext">llvmSection :: Section -&gt; LlvmM LMSection
</span><a href="GHC.CmmToLlvm.Data.html#llvmSection"><span class="hs-identifier hs-var hs-var">llvmSection</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#Section"><span class="hs-identifier hs-type">Section</span></a></span><span> </span><span id="local-6989586621681013183"><span class="annot"><span class="annottext">SectionType
</span><a href="#local-6989586621681013183"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span id="local-6989586621681013182"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681013182"><span class="hs-identifier hs-var">suffix</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-115"></span><span>  </span><span id="local-6989586621681013181"><span class="annot"><span class="annottext">LlvmOpts
</span><a href="#local-6989586621681013181"><span class="hs-identifier hs-var">opts</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LlvmM LlvmOpts
</span><a href="GHC.CmmToLlvm.Base.html#getLlvmOpts"><span class="hs-identifier hs-var">getLlvmOpts</span></a></span><span>
</span><span id="line-116"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681013179"><span class="annot"><span class="annottext">splitSect :: Bool
</span><a href="#local-6989586621681013179"><span class="hs-identifier hs-var hs-var">splitSect</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LlvmOpts -&gt; Bool
</span><a href="GHC.Llvm.Types.html#llvmOptsSplitSections"><span class="hs-identifier hs-var hs-var">llvmOptsSplitSections</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmOpts
</span><a href="#local-6989586621681013181"><span class="hs-identifier hs-var">opts</span></a></span><span>
</span><span id="line-117"></span><span>      </span><span id="local-6989586621681013177"><span class="annot"><span class="annottext">platform :: Platform
</span><a href="#local-6989586621681013177"><span class="hs-identifier hs-var hs-var">platform</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LlvmOpts -&gt; Platform
</span><a href="GHC.Llvm.Types.html#llvmOptsPlatform"><span class="hs-identifier hs-var hs-var">llvmOptsPlatform</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmOpts
</span><a href="#local-6989586621681013181"><span class="hs-identifier hs-var">opts</span></a></span><span>
</span><span id="line-118"></span><span>  </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681013179"><span class="hs-identifier hs-var">splitSect</span></a></span><span>
</span><span id="line-119"></span><span>  </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">LMSection -&gt; LlvmM LMSection
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">LMSection
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-120"></span><span>  </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-121"></span><span>    </span><span id="local-6989586621681013174"><span class="annot"><span class="annottext">LMString
</span><a href="#local-6989586621681013174"><span class="hs-identifier hs-var">lmsuffix</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; LlvmM LMString
</span><a href="GHC.CmmToLlvm.Base.html#strCLabel_llvm"><span class="hs-identifier hs-var">strCLabel_llvm</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681013182"><span class="hs-identifier hs-var">suffix</span></a></span><span>
</span><span id="line-122"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681013173"><span class="annot"><span class="annottext">result :: String -&gt; LMSection
</span><a href="#local-6989586621681013173"><span class="hs-identifier hs-var hs-var">result</span></a></span></span><span> </span><span id="local-6989586621681013172"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681013172"><span class="hs-identifier hs-var">sep</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LMString -&gt; LMSection
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[LMString] -&gt; LMString
</span><a href="GHC.Data.FastString.html#concatFS"><span class="hs-identifier hs-var">concatFS</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Platform -&gt; SectionType -&gt; LMString
</span><a href="GHC.CmmToLlvm.Data.html#llvmSectionType"><span class="hs-identifier hs-var">llvmSectionType</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681013177"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">SectionType
</span><a href="#local-6989586621681013183"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-123"></span><span>                                    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; LMString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681013172"><span class="hs-identifier hs-var">sep</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">LMString
</span><a href="#local-6989586621681013174"><span class="hs-identifier hs-var">lmsuffix</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-124"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; OS
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformOS"><span class="hs-identifier hs-var">platformOS</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681013177"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-125"></span><span>      </span><span class="annot"><span class="annottext">OS
</span><a href="../../ghc-boot/src/GHC.Platform.html#OSMinGW32"><span class="hs-identifier hs-var">OSMinGW32</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">LMSection -&gt; LlvmM LMSection
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; LMSection
</span><a href="#local-6989586621681013173"><span class="hs-identifier hs-var">result</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;$&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-126"></span><span>      </span><span class="annot"><span class="annottext">OS
</span><span class="hs-identifier">_</span></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">LMSection -&gt; LlvmM LMSection
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; LMSection
</span><a href="#local-6989586621681013173"><span class="hs-identifier hs-var">result</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;.&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-127"></span><span>
</span><span id="line-128"></span><span class="hs-comment">-- ----------------------------------------------------------------------------</span><span>
</span><span id="line-129"></span><span class="hs-comment">-- * Generate static data</span><span>
</span><span id="line-130"></span><span class="hs-comment">--</span><span>
</span><span id="line-131"></span><span>
</span><span id="line-132"></span><span class="hs-comment">-- | Handle static data</span><span>
</span><span id="line-133"></span><span class="annot"><a href="GHC.CmmToLlvm.Data.html#genData"><span class="hs-identifier hs-type">genData</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmStatic"><span class="hs-identifier hs-type">CmmStatic</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CmmToLlvm.Base.html#LlvmM"><span class="hs-identifier hs-type">LlvmM</span></a></span><span> </span><span class="annot"><a href="GHC.Llvm.Types.html#LlvmStatic"><span class="hs-identifier hs-type">LlvmStatic</span></a></span><span>
</span><span id="line-134"></span><span>
</span><span id="line-135"></span><span id="genData"><span class="annot"><span class="annottext">genData :: CmmStatic -&gt; LlvmM LlvmStatic
</span><a href="GHC.CmmToLlvm.Data.html#genData"><span class="hs-identifier hs-var hs-var">genData</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#CmmFileEmbed"><span class="hs-identifier hs-type">CmmFileEmbed</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; LlvmM LlvmStatic
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Unexpected CmmFileEmbed literal&quot;</span></span><span>
</span><span id="line-136"></span><span class="annot"><a href="GHC.CmmToLlvm.Data.html#genData"><span class="hs-identifier hs-var">genData</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#CmmString"><span class="hs-identifier hs-type">CmmString</span></a></span><span> </span><span id="local-6989586621681013168"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621681013168"><span class="hs-identifier hs-var">str</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-137"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681013163"><span class="annot"><span class="annottext">v :: [LlvmStatic]
</span><a href="#local-6989586621681013163"><span class="hs-identifier hs-var hs-var">v</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; LlvmStatic) -&gt; [Word8] -&gt; [LlvmStatic]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681013162"><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621681013162"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">LlvmLit -&gt; LlvmStatic
</span><a href="GHC.Llvm.Types.html#LMStaticLit"><span class="hs-identifier hs-var">LMStaticLit</span></a></span><span> </span><span class="annot"><span class="annottext">(LlvmLit -&gt; LlvmStatic) -&gt; LlvmLit -&gt; LlvmStatic
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; LlvmType -&gt; LlvmLit
</span><a href="GHC.Llvm.Types.html#LMIntLit"><span class="hs-identifier hs-var">LMIntLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8 -&gt; Integer
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621681013162"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LlvmType
</span><a href="GHC.Llvm.Types.html#i8"><span class="hs-identifier hs-var">i8</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-138"></span><span>                 </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; [Word8]
</span><a href="../../bytestring/src/Data.ByteString.html#unpack"><span class="hs-identifier hs-var">BS.unpack</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621681013168"><span class="hs-identifier hs-var">str</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-139"></span><span>        </span><span id="local-6989586621681013157"><span class="annot"><span class="annottext">ve :: [LlvmStatic]
</span><a href="#local-6989586621681013157"><span class="hs-identifier hs-var hs-var">ve</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[LlvmStatic]
</span><a href="#local-6989586621681013163"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">[LlvmStatic] -&gt; [LlvmStatic] -&gt; [LlvmStatic]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">LlvmLit -&gt; LlvmStatic
</span><a href="GHC.Llvm.Types.html#LMStaticLit"><span class="hs-identifier hs-var">LMStaticLit</span></a></span><span> </span><span class="annot"><span class="annottext">(LlvmLit -&gt; LlvmStatic) -&gt; LlvmLit -&gt; LlvmStatic
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; LlvmType -&gt; LlvmLit
</span><a href="GHC.Llvm.Types.html#LMIntLit"><span class="hs-identifier hs-var">LMIntLit</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">LlvmType
</span><a href="GHC.Llvm.Types.html#i8"><span class="hs-identifier hs-var">i8</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-140"></span><span>    </span><span class="annot"><span class="annottext">LlvmStatic -&gt; LlvmM LlvmStatic
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(LlvmStatic -&gt; LlvmM LlvmStatic) -&gt; LlvmStatic -&gt; LlvmM LlvmStatic
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[LlvmStatic] -&gt; LlvmType -&gt; LlvmStatic
</span><a href="GHC.Llvm.Types.html#LMStaticArray"><span class="hs-identifier hs-var">LMStaticArray</span></a></span><span> </span><span class="annot"><span class="annottext">[LlvmStatic]
</span><a href="#local-6989586621681013157"><span class="hs-identifier hs-var">ve</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; LlvmType -&gt; LlvmType
</span><a href="GHC.Llvm.Types.html#LMArray"><span class="hs-identifier hs-var">LMArray</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[LlvmStatic] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[LlvmStatic]
</span><a href="#local-6989586621681013157"><span class="hs-identifier hs-var">ve</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LlvmType
</span><a href="GHC.Llvm.Types.html#i8"><span class="hs-identifier hs-var">i8</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-141"></span><span>
</span><span id="line-142"></span><span class="annot"><a href="GHC.CmmToLlvm.Data.html#genData"><span class="hs-identifier hs-var">genData</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#CmmUninitialised"><span class="hs-identifier hs-type">CmmUninitialised</span></a></span><span> </span><span id="local-6989586621681013152"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681013152"><span class="hs-identifier hs-var">bytes</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-143"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LlvmStatic -&gt; LlvmM LlvmStatic
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(LlvmStatic -&gt; LlvmM LlvmStatic) -&gt; LlvmStatic -&gt; LlvmM LlvmStatic
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmType -&gt; LlvmStatic
</span><a href="GHC.Llvm.Types.html#LMUninitType"><span class="hs-identifier hs-var">LMUninitType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; LlvmType -&gt; LlvmType
</span><a href="GHC.Llvm.Types.html#LMArray"><span class="hs-identifier hs-var">LMArray</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681013152"><span class="hs-identifier hs-var">bytes</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmType
</span><a href="GHC.Llvm.Types.html#i8"><span class="hs-identifier hs-var">i8</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-144"></span><span>
</span><span id="line-145"></span><span class="annot"><a href="GHC.CmmToLlvm.Data.html#genData"><span class="hs-identifier hs-var">genData</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#CmmStaticLit"><span class="hs-identifier hs-type">CmmStaticLit</span></a></span><span> </span><span id="local-6989586621681013150"><span class="annot"><span class="annottext">CmmLit
</span><a href="#local-6989586621681013150"><span class="hs-identifier hs-var">lit</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-146"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmLit -&gt; LlvmM LlvmStatic
</span><a href="GHC.CmmToLlvm.Data.html#genStaticLit"><span class="hs-identifier hs-var">genStaticLit</span></a></span><span> </span><span class="annot"><span class="annottext">CmmLit
</span><a href="#local-6989586621681013150"><span class="hs-identifier hs-var">lit</span></a></span><span>
</span><span id="line-147"></span><span>
</span><span id="line-148"></span><span class="hs-comment">-- | Generate Llvm code for a static literal.</span><span>
</span><span id="line-149"></span><span class="hs-comment">--</span><span>
</span><span id="line-150"></span><span class="hs-comment">-- Will either generate the code or leave it unresolved if it is a 'CLabel'</span><span>
</span><span id="line-151"></span><span class="hs-comment">-- which isn't yet known.</span><span>
</span><span id="line-152"></span><span class="annot"><a href="GHC.CmmToLlvm.Data.html#genStaticLit"><span class="hs-identifier hs-type">genStaticLit</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-type">CmmLit</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CmmToLlvm.Base.html#LlvmM"><span class="hs-identifier hs-type">LlvmM</span></a></span><span> </span><span class="annot"><a href="GHC.Llvm.Types.html#LlvmStatic"><span class="hs-identifier hs-type">LlvmStatic</span></a></span><span>
</span><span id="line-153"></span><span id="genStaticLit"><span class="annot"><span class="annottext">genStaticLit :: CmmLit -&gt; LlvmM LlvmStatic
</span><a href="GHC.CmmToLlvm.Data.html#genStaticLit"><span class="hs-identifier hs-var hs-var">genStaticLit</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmInt"><span class="hs-identifier hs-type">CmmInt</span></a></span><span> </span><span id="local-6989586621681013147"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681013147"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span id="local-6989586621681013146"><span class="annot"><span class="annottext">Width
</span><a href="#local-6989586621681013146"><span class="hs-identifier hs-var">w</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-154"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LlvmStatic -&gt; LlvmM LlvmStatic
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(LlvmStatic -&gt; LlvmM LlvmStatic) -&gt; LlvmStatic -&gt; LlvmM LlvmStatic
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmLit -&gt; LlvmStatic
</span><a href="GHC.Llvm.Types.html#LMStaticLit"><span class="hs-identifier hs-var">LMStaticLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; LlvmType -&gt; LlvmLit
</span><a href="GHC.Llvm.Types.html#LMIntLit"><span class="hs-identifier hs-var">LMIntLit</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681013147"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; LlvmType
</span><a href="GHC.Llvm.Types.html#LMInt"><span class="hs-identifier hs-var">LMInt</span></a></span><span> </span><span class="annot"><span class="annottext">(Int -&gt; LlvmType) -&gt; Int -&gt; LlvmType
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Width -&gt; Int
</span><a href="GHC.Cmm.Type.html#widthInBits"><span class="hs-identifier hs-var">widthInBits</span></a></span><span> </span><span class="annot"><span class="annottext">Width
</span><a href="#local-6989586621681013146"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-155"></span><span>
</span><span id="line-156"></span><span class="annot"><a href="GHC.CmmToLlvm.Data.html#genStaticLit"><span class="hs-identifier hs-var">genStaticLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmFloat"><span class="hs-identifier hs-type">CmmFloat</span></a></span><span> </span><span id="local-6989586621681013142"><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621681013142"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621681013141"><span class="annot"><span class="annottext">Width
</span><a href="#local-6989586621681013141"><span class="hs-identifier hs-var">w</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-157"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LlvmStatic -&gt; LlvmM LlvmStatic
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(LlvmStatic -&gt; LlvmM LlvmStatic) -&gt; LlvmStatic -&gt; LlvmM LlvmStatic
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmLit -&gt; LlvmStatic
</span><a href="GHC.Llvm.Types.html#LMStaticLit"><span class="hs-identifier hs-var">LMStaticLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Double -&gt; LlvmType -&gt; LlvmLit
</span><a href="GHC.Llvm.Types.html#LMFloatLit"><span class="hs-identifier hs-var">LMFloatLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Rational -&gt; Double
forall a. Fractional a =&gt; Rational -&gt; a
</span><a href="../../base/src/GHC.Real.html#fromRational"><span class="hs-identifier hs-var">fromRational</span></a></span><span> </span><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621681013142"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Width -&gt; LlvmType
</span><a href="GHC.CmmToLlvm.Base.html#widthToLlvmFloat"><span class="hs-identifier hs-var">widthToLlvmFloat</span></a></span><span> </span><span class="annot"><span class="annottext">Width
</span><a href="#local-6989586621681013141"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-158"></span><span>
</span><span id="line-159"></span><span class="annot"><a href="GHC.CmmToLlvm.Data.html#genStaticLit"><span class="hs-identifier hs-var">genStaticLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmVec"><span class="hs-identifier hs-type">CmmVec</span></a></span><span> </span><span id="local-6989586621681013137"><span class="annot"><span class="annottext">[CmmLit]
</span><a href="#local-6989586621681013137"><span class="hs-identifier hs-var">ls</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-160"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681013136"><span class="annot"><span class="annottext">[LlvmLit]
</span><a href="#local-6989586621681013136"><span class="hs-identifier hs-var">sls</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(CmmLit -&gt; LlvmM LlvmLit) -&gt; [CmmLit] -&gt; LlvmM [LlvmLit]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">CmmLit -&gt; LlvmM LlvmLit
</span><a href="#local-6989586621681013135"><span class="hs-identifier hs-var">toLlvmLit</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmLit]
</span><a href="#local-6989586621681013137"><span class="hs-identifier hs-var">ls</span></a></span><span>
</span><span id="line-161"></span><span>         </span><span class="annot"><span class="annottext">LlvmStatic -&gt; LlvmM LlvmStatic
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(LlvmStatic -&gt; LlvmM LlvmStatic) -&gt; LlvmStatic -&gt; LlvmM LlvmStatic
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmLit -&gt; LlvmStatic
</span><a href="GHC.Llvm.Types.html#LMStaticLit"><span class="hs-identifier hs-var">LMStaticLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[LlvmLit] -&gt; LlvmLit
</span><a href="GHC.Llvm.Types.html#LMVectorLit"><span class="hs-identifier hs-var">LMVectorLit</span></a></span><span> </span><span class="annot"><span class="annottext">[LlvmLit]
</span><a href="#local-6989586621681013136"><span class="hs-identifier hs-var">sls</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-162"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-163"></span><span>    </span><span class="annot"><a href="#local-6989586621681013135"><span class="hs-identifier hs-type">toLlvmLit</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-type">CmmLit</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CmmToLlvm.Base.html#LlvmM"><span class="hs-identifier hs-type">LlvmM</span></a></span><span> </span><span class="annot"><a href="GHC.Llvm.Types.html#LlvmLit"><span class="hs-identifier hs-type">LlvmLit</span></a></span><span>
</span><span id="line-164"></span><span>    </span><span id="local-6989586621681013135"><span class="annot"><span class="annottext">toLlvmLit :: CmmLit -&gt; LlvmM LlvmLit
</span><a href="#local-6989586621681013135"><span class="hs-identifier hs-var hs-var">toLlvmLit</span></a></span></span><span> </span><span id="local-6989586621681013133"><span class="annot"><span class="annottext">CmmLit
</span><a href="#local-6989586621681013133"><span class="hs-identifier hs-var">lit</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-165"></span><span>      </span><span id="local-6989586621681013132"><span class="annot"><span class="annottext">LlvmStatic
</span><a href="#local-6989586621681013132"><span class="hs-identifier hs-var">slit</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmmLit -&gt; LlvmM LlvmStatic
</span><a href="GHC.CmmToLlvm.Data.html#genStaticLit"><span class="hs-identifier hs-var">genStaticLit</span></a></span><span> </span><span class="annot"><span class="annottext">CmmLit
</span><a href="#local-6989586621681013133"><span class="hs-identifier hs-var">lit</span></a></span><span>
</span><span id="line-166"></span><span>      </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">LlvmStatic
</span><a href="#local-6989586621681013132"><span class="hs-identifier hs-var">slit</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-167"></span><span>        </span><span class="annot"><a href="GHC.Llvm.Types.html#LMStaticLit"><span class="hs-identifier hs-type">LMStaticLit</span></a></span><span> </span><span id="local-6989586621681013131"><span class="annot"><span class="annottext">LlvmLit
</span><a href="#local-6989586621681013131"><span class="hs-identifier hs-var">llvmLit</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">LlvmLit -&gt; LlvmM LlvmLit
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmLit
</span><a href="#local-6989586621681013131"><span class="hs-identifier hs-var">llvmLit</span></a></span><span>
</span><span id="line-168"></span><span>        </span><span class="annot"><span class="annottext">LlvmStatic
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; LlvmM LlvmLit
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;genStaticLit&quot;</span></span><span>
</span><span id="line-169"></span><span>
</span><span id="line-170"></span><span class="hs-comment">-- Leave unresolved, will fix later</span><span>
</span><span id="line-171"></span><span class="annot"><a href="GHC.CmmToLlvm.Data.html#genStaticLit"><span class="hs-identifier hs-var">genStaticLit</span></a></span><span> </span><span id="local-6989586621681013130"><span class="annot"><span class="annottext">cmm :: CmmLit
</span><a href="#local-6989586621681013130"><span class="hs-identifier hs-var">cmm</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLabel"><span class="hs-identifier hs-type">CmmLabel</span></a></span><span> </span><span id="local-6989586621681013129"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681013129"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-172"></span><span>    </span><span id="local-6989586621681013128"><span class="annot"><span class="annottext">LlvmVar
</span><a href="#local-6989586621681013128"><span class="hs-identifier hs-var">var</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LMString -&gt; LlvmM LlvmVar
</span><a href="GHC.CmmToLlvm.Base.html#getGlobalPtr"><span class="hs-identifier hs-var">getGlobalPtr</span></a></span><span> </span><span class="annot"><span class="annottext">(LMString -&gt; LlvmM LlvmVar) -&gt; LlvmM LMString -&gt; LlvmM LlvmVar
forall (m :: * -&gt; *) a b. Monad m =&gt; (a -&gt; m b) -&gt; m a -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3D%3C%3C"><span class="hs-operator hs-var">=&lt;&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; LlvmM LMString
</span><a href="GHC.CmmToLlvm.Base.html#strCLabel_llvm"><span class="hs-identifier hs-var">strCLabel_llvm</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681013129"><span class="hs-identifier hs-var">l</span></a></span><span>
</span><span id="line-173"></span><span>    </span><span id="local-6989586621681013125"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681013125"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LlvmM Platform
</span><a href="GHC.CmmToLlvm.Base.html#getPlatform"><span class="hs-identifier hs-var">getPlatform</span></a></span><span>
</span><span id="line-174"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681013124"><span class="annot"><span class="annottext">ptr :: LlvmStatic
</span><a href="#local-6989586621681013124"><span class="hs-identifier hs-var hs-var">ptr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LlvmVar -&gt; LlvmStatic
</span><a href="GHC.Llvm.Types.html#LMStaticPointer"><span class="hs-identifier hs-var">LMStaticPointer</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmVar
</span><a href="#local-6989586621681013128"><span class="hs-identifier hs-var">var</span></a></span><span>
</span><span id="line-175"></span><span>        </span><span id="local-6989586621681013123"><span class="annot"><span class="annottext">lmty :: LlvmType
</span><a href="#local-6989586621681013123"><span class="hs-identifier hs-var hs-var">lmty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmType -&gt; LlvmType
</span><a href="GHC.CmmToLlvm.Base.html#cmmToLlvmType"><span class="hs-identifier hs-var">cmmToLlvmType</span></a></span><span> </span><span class="annot"><span class="annottext">(CmmType -&gt; LlvmType) -&gt; CmmType -&gt; LlvmType
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Platform -&gt; CmmLit -&gt; CmmType
</span><a href="GHC.Cmm.Expr.html#cmmLitType"><span class="hs-identifier hs-var">cmmLitType</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681013125"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">CmmLit
</span><a href="#local-6989586621681013130"><span class="hs-identifier hs-var">cmm</span></a></span><span>
</span><span id="line-176"></span><span>    </span><span class="annot"><span class="annottext">LlvmStatic -&gt; LlvmM LlvmStatic
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(LlvmStatic -&gt; LlvmM LlvmStatic) -&gt; LlvmStatic -&gt; LlvmM LlvmStatic
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmStatic -&gt; LlvmType -&gt; LlvmStatic
</span><a href="GHC.Llvm.Types.html#LMPtoI"><span class="hs-identifier hs-var">LMPtoI</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmStatic
</span><a href="#local-6989586621681013124"><span class="hs-identifier hs-var">ptr</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmType
</span><a href="#local-6989586621681013123"><span class="hs-identifier hs-var">lmty</span></a></span><span>
</span><span id="line-177"></span><span>
</span><span id="line-178"></span><span class="annot"><a href="GHC.CmmToLlvm.Data.html#genStaticLit"><span class="hs-identifier hs-var">genStaticLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLabelOff"><span class="hs-identifier hs-type">CmmLabelOff</span></a></span><span> </span><span id="local-6989586621681013119"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681013119"><span class="hs-keyword hs-var">label</span></a></span></span><span> </span><span id="local-6989586621681013118"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681013118"><span class="hs-identifier hs-var">off</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-179"></span><span>    </span><span id="local-6989586621681013117"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681013117"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LlvmM Platform
</span><a href="GHC.CmmToLlvm.Base.html#getPlatform"><span class="hs-identifier hs-var">getPlatform</span></a></span><span>
</span><span id="line-180"></span><span>    </span><span id="local-6989586621681013116"><span class="annot"><span class="annottext">LlvmStatic
</span><a href="#local-6989586621681013116"><span class="hs-identifier hs-var">var</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmmLit -&gt; LlvmM LlvmStatic
</span><a href="GHC.CmmToLlvm.Data.html#genStaticLit"><span class="hs-identifier hs-var">genStaticLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CLabel -&gt; CmmLit
</span><a href="GHC.Cmm.Expr.html#CmmLabel"><span class="hs-identifier hs-var">CmmLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681013119"><span class="hs-keyword hs-var">label</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-181"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681013113"><span class="annot"><span class="annottext">offset :: LlvmStatic
</span><a href="#local-6989586621681013113"><span class="hs-identifier hs-var hs-var">offset</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LlvmLit -&gt; LlvmStatic
</span><a href="GHC.Llvm.Types.html#LMStaticLit"><span class="hs-identifier hs-var">LMStaticLit</span></a></span><span> </span><span class="annot"><span class="annottext">(LlvmLit -&gt; LlvmStatic) -&gt; LlvmLit -&gt; LlvmStatic
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; LlvmType -&gt; LlvmLit
</span><a href="GHC.Llvm.Types.html#LMIntLit"><span class="hs-identifier hs-var">LMIntLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Integer
forall a. Integral a =&gt; a -&gt; Integer
</span><a href="../../base/src/GHC.Real.html#toInteger"><span class="hs-identifier hs-var">toInteger</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681013118"><span class="hs-identifier hs-var">off</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; LlvmType
</span><a href="GHC.Llvm.Types.html#llvmWord"><span class="hs-identifier hs-var">llvmWord</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681013117"><span class="hs-identifier hs-var">platform</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-182"></span><span>    </span><span class="annot"><span class="annottext">LlvmStatic -&gt; LlvmM LlvmStatic
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(LlvmStatic -&gt; LlvmM LlvmStatic) -&gt; LlvmStatic -&gt; LlvmM LlvmStatic
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmStatic -&gt; LlvmStatic -&gt; LlvmStatic
</span><a href="GHC.Llvm.Types.html#LMAdd"><span class="hs-identifier hs-var">LMAdd</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmStatic
</span><a href="#local-6989586621681013116"><span class="hs-identifier hs-var">var</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmStatic
</span><a href="#local-6989586621681013113"><span class="hs-identifier hs-var">offset</span></a></span><span>
</span><span id="line-183"></span><span>
</span><span id="line-184"></span><span class="annot"><a href="GHC.CmmToLlvm.Data.html#genStaticLit"><span class="hs-identifier hs-var">genStaticLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLabelDiffOff"><span class="hs-identifier hs-type">CmmLabelDiffOff</span></a></span><span> </span><span id="local-6989586621681013109"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681013109"><span class="hs-identifier hs-var">l1</span></a></span></span><span> </span><span id="local-6989586621681013108"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681013108"><span class="hs-identifier hs-var">l2</span></a></span></span><span> </span><span id="local-6989586621681013107"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681013107"><span class="hs-identifier hs-var">off</span></a></span></span><span> </span><span id="local-6989586621681013106"><span class="annot"><span class="annottext">Width
</span><a href="#local-6989586621681013106"><span class="hs-identifier hs-var">w</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-185"></span><span>    </span><span id="local-6989586621681013105"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681013105"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LlvmM Platform
</span><a href="GHC.CmmToLlvm.Base.html#getPlatform"><span class="hs-identifier hs-var">getPlatform</span></a></span><span>
</span><span id="line-186"></span><span>    </span><span id="local-6989586621681013104"><span class="annot"><span class="annottext">LlvmStatic
</span><a href="#local-6989586621681013104"><span class="hs-identifier hs-var">var1</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmmLit -&gt; LlvmM LlvmStatic
</span><a href="GHC.CmmToLlvm.Data.html#genStaticLit"><span class="hs-identifier hs-var">genStaticLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CLabel -&gt; CmmLit
</span><a href="GHC.Cmm.Expr.html#CmmLabel"><span class="hs-identifier hs-var">CmmLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681013109"><span class="hs-identifier hs-var">l1</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-187"></span><span>    </span><span id="local-6989586621681013103"><span class="annot"><span class="annottext">LlvmStatic
</span><a href="#local-6989586621681013103"><span class="hs-identifier hs-var">var2</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmmLit -&gt; LlvmM LlvmStatic
</span><a href="GHC.CmmToLlvm.Data.html#genStaticLit"><span class="hs-identifier hs-var">genStaticLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CLabel -&gt; CmmLit
</span><a href="GHC.Cmm.Expr.html#CmmLabel"><span class="hs-identifier hs-var">CmmLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681013108"><span class="hs-identifier hs-var">l2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-188"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681013100"><span class="annot"><span class="annottext">var :: LlvmStatic
</span><a href="#local-6989586621681013100"><span class="hs-identifier hs-var hs-var">var</span></a></span></span><span>
</span><span id="line-189"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Width
</span><a href="#local-6989586621681013106"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Width -&gt; Width -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Platform -&gt; Width
</span><a href="GHC.Cmm.Type.html#wordWidth"><span class="hs-identifier hs-var">wordWidth</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681013105"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LlvmStatic -&gt; LlvmStatic -&gt; LlvmStatic
</span><a href="GHC.Llvm.Types.html#LMSub"><span class="hs-identifier hs-var">LMSub</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmStatic
</span><a href="#local-6989586621681013104"><span class="hs-identifier hs-var">var1</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmStatic
</span><a href="#local-6989586621681013103"><span class="hs-identifier hs-var">var2</span></a></span><span>
</span><span id="line-190"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LlvmStatic -&gt; LlvmType -&gt; LlvmStatic
</span><a href="GHC.Llvm.Types.html#LMTrunc"><span class="hs-identifier hs-var">LMTrunc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LlvmStatic -&gt; LlvmStatic -&gt; LlvmStatic
</span><a href="GHC.Llvm.Types.html#LMSub"><span class="hs-identifier hs-var">LMSub</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmStatic
</span><a href="#local-6989586621681013104"><span class="hs-identifier hs-var">var1</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmStatic
</span><a href="#local-6989586621681013103"><span class="hs-identifier hs-var">var2</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Width -&gt; LlvmType
</span><a href="GHC.CmmToLlvm.Base.html#widthToLlvmInt"><span class="hs-identifier hs-var">widthToLlvmInt</span></a></span><span> </span><span class="annot"><span class="annottext">Width
</span><a href="#local-6989586621681013106"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-191"></span><span>        </span><span id="local-6989586621681013094"><span class="annot"><span class="annottext">offset :: LlvmStatic
</span><a href="#local-6989586621681013094"><span class="hs-identifier hs-var hs-var">offset</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LlvmLit -&gt; LlvmStatic
</span><a href="GHC.Llvm.Types.html#LMStaticLit"><span class="hs-identifier hs-var">LMStaticLit</span></a></span><span> </span><span class="annot"><span class="annottext">(LlvmLit -&gt; LlvmStatic) -&gt; LlvmLit -&gt; LlvmStatic
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; LlvmType -&gt; LlvmLit
</span><a href="GHC.Llvm.Types.html#LMIntLit"><span class="hs-identifier hs-var">LMIntLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Integer
forall a. Integral a =&gt; a -&gt; Integer
</span><a href="../../base/src/GHC.Real.html#toInteger"><span class="hs-identifier hs-var">toInteger</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681013107"><span class="hs-identifier hs-var">off</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; LlvmType
</span><a href="GHC.Llvm.Types.html#LMInt"><span class="hs-identifier hs-var">LMInt</span></a></span><span> </span><span class="annot"><span class="annottext">(Int -&gt; LlvmType) -&gt; Int -&gt; LlvmType
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Width -&gt; Int
</span><a href="GHC.Cmm.Type.html#widthInBits"><span class="hs-identifier hs-var">widthInBits</span></a></span><span> </span><span class="annot"><span class="annottext">Width
</span><a href="#local-6989586621681013106"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-192"></span><span>    </span><span class="annot"><span class="annottext">LlvmStatic -&gt; LlvmM LlvmStatic
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(LlvmStatic -&gt; LlvmM LlvmStatic) -&gt; LlvmStatic -&gt; LlvmM LlvmStatic
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmStatic -&gt; LlvmStatic -&gt; LlvmStatic
</span><a href="GHC.Llvm.Types.html#LMAdd"><span class="hs-identifier hs-var">LMAdd</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmStatic
</span><a href="#local-6989586621681013100"><span class="hs-identifier hs-var">var</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmStatic
</span><a href="#local-6989586621681013094"><span class="hs-identifier hs-var">offset</span></a></span><span>
</span><span id="line-193"></span><span>
</span><span id="line-194"></span><span class="annot"><a href="GHC.CmmToLlvm.Data.html#genStaticLit"><span class="hs-identifier hs-var">genStaticLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span> </span><span id="local-6989586621681013092"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681013092"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmLit -&gt; LlvmM LlvmStatic
</span><a href="GHC.CmmToLlvm.Data.html#genStaticLit"><span class="hs-identifier hs-var">genStaticLit</span></a></span><span> </span><span class="annot"><span class="annottext">(CmmLit -&gt; LlvmM LlvmStatic) -&gt; CmmLit -&gt; LlvmM LlvmStatic
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; CmmLit
</span><a href="GHC.Cmm.Expr.html#CmmLabel"><span class="hs-identifier hs-var">CmmLabel</span></a></span><span> </span><span class="annot"><span class="annottext">(CLabel -&gt; CmmLit) -&gt; CLabel -&gt; CmmLit
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; CLabel
</span><a href="GHC.Cmm.BlockId.html#infoTblLbl"><span class="hs-identifier hs-var">infoTblLbl</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681013092"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-195"></span><span>
</span><span id="line-196"></span><span class="annot"><a href="GHC.CmmToLlvm.Data.html#genStaticLit"><span class="hs-identifier hs-var">genStaticLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmLit
</span><a href="GHC.Cmm.Expr.html#CmmHighStackMark"><span class="hs-identifier hs-var">CmmHighStackMark</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-197"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; LlvmM LlvmStatic
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;genStaticLit: CmmHighStackMark unsupported!&quot;</span></span><span>
</span><span id="line-198"></span></pre></body></html>